//https://leetcode.cn/problems/unique-paths/
#include <vector>
#include <stack>
#include <list>
#include <map>
#include <string>
#include <unordered_map>
#include <algorithm>

using namespace std;


class Solution {
public:
    int uniquePaths(int m, int n) {
        std::vector<std::vector<int>>  vec_vec(m,std::vector<int>(n,0));
        for(int i=0;i<n;++i){
            vec_vec[m-1][i]=1;
        }
        for(int i=0;i<m;++i){
            vec_vec[i][n-1]=1;
        }
        for(int i=m-2;i>=0;--i){
            for(int j=n-2;j>=0;--j){
                vec_vec[i][j]=vec_vec[i][j+1]+vec_vec[i+1][j];
            }
        }
        return vec_vec[0][0];
    }
};